<template>
  <div class="Electricity">
    <el-tabs v-model="activeName" @tab-click="handleClick">
      <el-tab-pane label="企业用电" name="enterprise"></el-tab-pane>
      <el-tab-pane label="车间用电" name="workshop"></el-tab-pane>
    </el-tabs>
    <router-view></router-view>
  </div>
</template>

<script>
export default {
  components: {
  },
  watch: {
  },
  data() {
    return {
      activeName: '',
    }
  },
  mounted() {
  },
  watch: {
    $route(n, o) {
      this.activeName = n.name
    }
  },
  created() {
    this.activeName = this.$route.name
  },
  methods: {
    handleClick(tab, event) {
      console.log(tab.name)
      this.$router.push({ name: tab.name })
    },
  }
}
</script>
 <style scoped lang='scss'>
</style>
